package com.briup.cms.web.controller;

import com.briup.cms.bean.Test;
import com.briup.cms.service.ITestService;
import com.briup.cms.utils.Message;
import com.briup.cms.utils.MessageUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @program: Consult_Management_Syetem1
 * @description:
 * @author: Number 4
 * @create: 2020-07-02
 **/
@Api(description = "测试接口")
@RestController
@RequestMapping("/test")
public class TestController {
    @Autowired
    private ITestService testService;

    @ApiOperation("查询所有")
    @GetMapping("findAll")
    public Message findAll(){
        List<Test> list = testService.findAll();
        return MessageUtil.success(list);
    }

    @ApiOperation("保存或更新")
    @PostMapping("saveOrUpdate")
    public Message saveOrUpdate(Test test){
        //
        return MessageUtil.success("操作成功");
    }
}
